#!/bin/bash

export proxy_port=8118
if [ $UploadVpnPort ]; then
  proxy_port=$UploadVpnPort
  echo 'find UploadVpnPort:$UploadVpnPort'
fi

function proxy_on(){
    export http_proxy=http://127.0.0.1:$proxy_port
    export https_proxy=http://127.0.0.1:$proxy_port
    export http_proxyHost=127.0.0.1
    export http_proxyPort=$proxy_port
    export https_proxyHost=127.0.0.1
    export https_proxyPort=$proxy_port
    echo -e "已开启代理, using port:$proxy_port"
    curl https://www.google.com/ncr/
}
function proxy_off(){
    unset http_proxy
    unset https_proxy
    unset http_proxyHost
    unset http_proxyPort
    unset https_proxyHost
    unset https_proxyPort
    echo -e "已关闭代理"
}
function ipinfo(){
    curl ipinfo.io/json
}
